package com.fit.dao.destination;

import java.util.List;

import org.apache.tapestry5.ioc.annotations.Inject;
import org.hibernate.Session;

import com.fit.entities.Destination;

public class DestinationDAOImpl implements DestinationDAO{
	
	@Inject
	private Session session;

	public boolean save(Destination destination) {
		if (destination != null) {
			session.save(destination);
			return true;
		}
		return false;
	}

	public Destination findById(Long id) {
		return (Destination) session.get(Destination.class, id);
	}

	public List<Destination> findAll() {
		return session.createCriteria(Destination.class).list();
	}

}
